/**
 * 
 */
package com.ms.service.module.baccarat;

import com.ms.service.module.baccarat.db.BacrActivityCombosInfoModel;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.group.transportlayer.GroupMessage;
import com.xpec.c4.service.message.MessageAction;
import com.xpec.c4.service.module.ConsistentGroupName;
import com.xpec.c4.service.module.ModuleName;

/**
 * 百家樂相關 API
 * 
 * @author TW15010
 */
public class BacrAPI {
	/**
	 * 通所有的百家樂 module 啟動遊戲
	 * 
	 * @param waitTimeDuration
	 *            啟動前等待的時間 (ms)
	 */
	public static void sendStartGameNotify(long waitTimeDuration) {
		GroupMessage gm = new GroupMessage();
		gm.setMessageType(MessageTypes.S_BACR_START_GAME_NOTIFY);
		gm.setMessageContent(waitTimeDuration);
		gm.setDestModuleID(ModuleName.BACR_GAME);

		MessageAction.sendGroupMessage(gm);
	}
	
	/**
	 * 設定DB內的活動連勝參數&讓所有桌重新LOAD資料<br>
	 * 如果指令接受，會重置當前所有玩家已存在的活動連勝紀錄
	 */
	public static void setBacrActivityCombosInfo(BacrActivityCombosInfoModel model){
		GroupMessage GMToolSettingCommand = new GroupMessage();
		GMToolSettingCommand.setMessageType(MessageTypes.S_GMTOOL_SET_BACR_ACTIVITY_COMBOS_INFO);
		GMToolSettingCommand.setMessageContent(model);
		//對指定的MODULE送消息
		String destModule = ConsistentGroupName.lookUpByString(ModuleName.GROUP_BACR, model.getTableID());
		GMToolSettingCommand.setDestModuleID(destModule);
		MessageAction.sendGroupMessage(GMToolSettingCommand);
	}
}
